package com.sambo.inspection.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.sambo.inspection.R;
import com.sambo.inspection.activity.support.BaseActivity;
import com.sambo.inspection.bean.PartitionBean;

public class PartitionDetailsActivity extends BaseActivity implements View.OnClickListener {
    ImageView ivBack;
    TextView tvPartitionNameTitle;
    TextView tvPartitionName;
    TextView tvPartitionCode;
    TextView tvPartitionAcreage;
    TextView tvWaterDemand;
    TextView tvPartitionDesc;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_partition_details);

        ivBack = findViewById(R.id.iv_back);
        tvPartitionNameTitle = findViewById(R.id.tv_partition_name_title);
        tvPartitionName = findViewById(R.id.tv_partition_name);
        tvPartitionCode = findViewById(R.id.tv_partition_code);
        tvPartitionAcreage = findViewById(R.id.tv_partition_acreage);
        tvWaterDemand = findViewById(R.id.tv_water_demand);
        tvPartitionDesc = findViewById(R.id.tv_partition_desc);

        PartitionBean bean = (PartitionBean) getIntent().getSerializableExtra("model");
        tvPartitionNameTitle.setText(bean.getDeptName());
        tvPartitionName.setText(bean.getDeptName());
        tvPartitionCode.setText(bean.getId());
        tvPartitionAcreage.setText(String.valueOf(bean.getAcreage()));
        tvWaterDemand.setText(String.valueOf(bean.getWaterDemand()));
//        tvPartitionDesc.setText(bean.get);

        ivBack.setOnClickListener(this);

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.iv_back:
                finish();
                break;
        }
    }
}
